/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "contabil_dre_detalhe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ContabilDreDetalhe.findAll", query = "SELECT c FROM ContabilDreDetalhe c")})
public class ContabilDreDetalhe implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 30)
    private String classificacao;
    @Column(length = 100)
    private String descricao;
    @Column(name = "FORMA_CALCULO")
    private Character formaCalculo;
    private Character sinal;
    private Character natureza;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(precision = 18, scale = 6)
    private BigDecimal valor;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idContabilDreDetalhe")
    private List<ContabilDreVinculo> contabilDreVinculoList;
    @JoinColumn(name = "ID_CONTABIL_DRE_CABECALHO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private ContabilDreCabecalho idContabilDreCabecalho;

    public ContabilDreDetalhe() {
    }

    public ContabilDreDetalhe(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getClassificacao() {
        return classificacao;
    }

    public void setClassificacao(String classificacao) {
        this.classificacao = classificacao;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Character getFormaCalculo() {
        return formaCalculo;
    }

    public void setFormaCalculo(Character formaCalculo) {
        this.formaCalculo = formaCalculo;
    }

    public Character getSinal() {
        return sinal;
    }

    public void setSinal(Character sinal) {
        this.sinal = sinal;
    }

    public Character getNatureza() {
        return natureza;
    }

    public void setNatureza(Character natureza) {
        this.natureza = natureza;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    @XmlTransient
    public List<ContabilDreVinculo> getContabilDreVinculoList() {
        return contabilDreVinculoList;
    }

    public void setContabilDreVinculoList(List<ContabilDreVinculo> contabilDreVinculoList) {
        this.contabilDreVinculoList = contabilDreVinculoList;
    }

    public ContabilDreCabecalho getIdContabilDreCabecalho() {
        return idContabilDreCabecalho;
    }

    public void setIdContabilDreCabecalho(ContabilDreCabecalho idContabilDreCabecalho) {
        this.idContabilDreCabecalho = idContabilDreCabecalho;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ContabilDreDetalhe)) {
            return false;
        }
        ContabilDreDetalhe other = (ContabilDreDetalhe) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.ContabilDreDetalhe[ id=" + id + " ]";
    }
    
}
